package cn.piesat.springsecurity.exception;


import cn.piesat.springsecurity.base.BaseCodeEnum;

/**
 * @author HuangAnting
 * @Description 基础异常
 * @date 2021/9/18 17:38
 */
public class BaseException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    private String code;
    private String message;

    public BaseException(BaseCodeEnum baseCodeEnum) {
        this.code = baseCodeEnum.getCode();
        this.message = baseCodeEnum.getMessage();
    }

    public BaseException(String value, String msg) {
        this.code = msg;
        this.message = value;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
